
public class ClassTest {

	public static void main(String[] args) {

		System.out.println("calling A.sMethod(): ");
		A.sMethod();
		
		System.out.println("calling B.sMethod(): ");
		B.sMethod();
		System.out.println("=================");

		A a = new A();
		B b = new B();
		
		a.mA();
		b.mA();
		
		B anotherB = (B) a;
		anotherB.mB();
	}
	
	

}

class A {
	
	public A() {
		System.out.println("--- A constructor called.");
	}
	
	public A(String s1) {
		System.out.println("--- A constructor with 1 arg called.");
	}
	
	public static void sMethod() {
		System.out.println("--- A.sMethod() called.");
	}
	
	public void mA() {
		System.out.println("--- A mA() called.");
	}
}

class B extends A {
	
	public B() {
		System.out.println("--- B constructor called.");
	}
	
	public B(String s1) {
//		super(s1);
		System.out.println("--- B constructor with 1 arg called.");
	}
	
	public static void sMethod() {
		System.out.println("--- B.sMethod() called.");
	}
	
	public void mB() {
		System.out.println("--- B mB() called.");
	}
	
}